package com.xuxk.project.library.controller.api;

import com.xuxk.project.library.util.ResultBodyVo;
import com.xuxk.project.util.ErrorCodeException;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.MediaType;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

/**
 * @author 许孝康
 * @date 2020/7/29
 * @company 橙云科技有限公司
 */
@RestController
@RequestMapping("/api")
public class LoginController {



    @PostMapping(value = "/login", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "用户登录",notes = "用户登录接口",httpMethod = "post")
    public ResultBodyVo login(String loginCode, String pw){

        Assert.notNull(loginCode,"登录账号不能为空！");
        if(StringUtils.isBlank(pw)){
            throw new ErrorCodeException("登录密码不能为空！");
        }
        return new ResultBodyVo("登录成功！");
    }


}
